<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="/common/commonHead :: commonHead('用户组管理')"></head>
<body>
<div th:replace="/common/titleNav :: titleNavDiv"></div>
<div class="content" th:with="oneMenu='2',twoMenu='4'">
    <div th:replace="/common/sidebarNav :: sidebarDiv"></div>
    <div class="main">
        <div class="right">
            <ol class="breadcrumb" style="margin-top:15px;">
                <li><a th:href="@{/userGroup/list}">用户组管理</a></li>
                <li class="active">用户组</li>
            </ol>
            <ul id="myTab" class="nav nav-tabs">
                <li class="active base">
                    <a href="#base" data-toggle="tab">
                        基本信息
                    </a>
                </li>
                <li class="users" th:if="${entity?.id != null}">
                    <a href="#users" data-toggle="tab">
                        用户
                    </a>
                </li>

                <li class="roles" th:if="${entity?.id != null}">
                    <a href="#roles" data-toggle="tab">
                        角色
                    </a>
                </li>
            </ul>
            <div id="tabContent" class="tab-content">
                <div class="tab-pane active" id="base" th:include="/admin/userGroup/tab_base :: base"></div>
                <div class="tab-pane" id="users" th:include="/admin/userGroup/tab_user :: user" th:if="${entity?.id != null}"></div>
                <div class="tab-pane" id="roles" th:include="/admin/userGroup/tab_role :: role" th:if="${entity?.id != null}"></div>
            </div>
        </div>
    </div>
</div>

<form th:action="@{/userGroup/edit}" method="post" id="tabForm">
    <input type="hidden" name="id" id="entityId" th:value="${entity?.id}"/>
    <input type="hidden" name="tab" value=""/>
    <input type="hidden" name="uPage" th:value="${userDto.uPage}"/>
    <input type="hidden" name="uRows" th:value="${userDto.uRows}"/>
    <input type="hidden" name="rPage" th:value="${userDto.rPage}"/>
    <input type="hidden" name="rRows" th:value="${userDto.rRows}"/>
    <input type="hidden" name="plPage" th:value="${userDto.plPage}"/>
    <input type="hidden" name="plRows" th:value="${userDto.plRows}"/>
    <input type="hidden" name="pPage" th:value="${userDto.pPage}"/>
    <input type="hidden" name="pRows" th:value="${userDto.pRows}"/>

    <input type="hidden" name="loginId" th:value="${param.loginId}"/>
    <input type="hidden" name="userName" th:value="${param.userName}"/>
    <input type="hidden" name="enabled" th:value="${param.enabled}"/>
    <input type="hidden" name="deptNumber" th:value="${param.deptNumber}"/>
    <input type="hidden" name="deptName" th:value="${param.deptName}"/>
    <input type="hidden" name="page" th:value="${param.page}"/>
    <input type="hidden" name="rows" th:value="${param.rows}"/>
</form>
<form th:action="@{/userGroup/list}" method="post" id="backForm">
    <input type="hidden" name="loginId" th:value="${param.loginId}"/>
    <input type="hidden" name="userName" th:value="${param.userName}"/>
    <input type="hidden" name="enabled" th:value="${param.enabled}"/>
    <input type="hidden" name="deptNumber" th:value="${param.deptNumber}"/>
    <input type="hidden" name="deptName" th:value="${param.deptName}"/>
    <input type="hidden" name="page" th:value="${param.page}"/>
    <input type="hidden" name="rows" th:value="${param.rows}"/>
</form>
<input type="hidden" th:value="${user?.id}" id="userId">

<!-- 模态框（Modal） -->
<div class="modal fade" id="addRole" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="myModalLabel">添加角色</h4>
            </div>
            <div class="modal-body">
                <div class="pop-search-list">
                    <div class="form-group">
                        <label class="control-label">角色名称：</label>
                        <input class="form-control s" type="text" id="name" placeholder="请输入"/>
                        <label class="control-label">角色描述：</label>
                        <input class="form-control s" type="text" id="description" placeholder="请输入"/>
                    </div>
                    <div class="btn-group-box">
                        <button type="button" class="btn btn-primary btn-sm" id="queryRole">查询</button>
                        <button type="button" class="btn btn-default border-blue btn-sm" id="resetRole">重置</button>
                    </div>
                </div>
                <div class="scroll-body">
                    <table class="table table-bordered table-hover table-condensed">
                        <thead>
                        <tr>
                            <th width="10%" class="left"><input type="checkbox" id="selectRoleListAll"/></th>
                            <th width="30%">角色名称</th>
                            <th width="40%">角色描述</th>
                            <th width="20%" class="right">状态</th>
                        </tr>
                        </thead>
                        <tbody id="roleTable">

                        </tbody>
                    </table>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" id="batchSaveRole">确定</button>
                <button type="button" class="btn btn-default border-blue" data-dismiss="modal">取消</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<!-- 模态框（Modal） -->
<div class="modal fade" id="addUser" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="myModalLabel">添加用户</h4>
            </div>
            <div class="modal-body">
                <div class="pop-search-list">
                    <div class="form-group">
                        <label class="control-label">登录账号：</label>
                        <input class="form-control s" type="text" id="loginId" placeholder="精确查询"/>
                        <label class="control-label">姓名：</label>
                        <input class="form-control s" type="text" id="userName" placeholder="请输入"/>
                    </div>
                    <div class="form-group">
                        <label class="control-label">部门名称：</label>
                        <input class="form-control s" type="text" id="deptName" placeholder="请输入"/>
                        <label class="control-label">状态：</label>
                        <select id="enabled">
                            <option value="">请选择</option>
                            <option value="1">启用</option>
                            <option value="0">禁用</option>
                        </select>
                    </div>
                    <div class="btn-group-box">
                        <button type="button" class="btn btn-primary btn-sm" id="queryUser">查询</button>
                        <button type="button" class="btn btn-default border-blue btn-sm" id="resetUser">重置</button>
                    </div>
                </div>
                <div class="scroll-body">
                    <table class="table table-bordered table-hover table-condensed">
                        <thead>
                        <tr>
                            <th width="10%" class="left"><input type="checkbox" id="selectUserListAll"/></th>
                            <th width="20%">登录账号</th>
                            <th width="20%">姓名</th>
                            <th width="40%">部门名称</th>
                            <th width="10%">状态</th>
                        </tr>
                        </thead>
                        <tbody id="userTable">

                        </tbody>
                    </table>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" id="batchSave">确定</button>
                <button type="button" class="btn btn-default border-blue" data-dismiss="modal">取消</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<!-- 模态框（Modal） -->
<div class="modal fade" id="batchAddUsers" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="myModalLabel">批量添加用户</h4>
            </div>
            <div class="modal-body">
                <label>登录账号之间用逗号分隔：</label>
                <textarea rows="4" cols="100" id="loginIds" placeholder="请输入登录账号之间用逗号分隔"></textarea>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" id="batchSaveByLoginId">确定</button>
                <button type="button" class="btn btn-default border-blue" data-dismiss="modal">取消</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<script type="text/javascript" th:src="@{/static/javascript/admin/userGroup/edit.js}"></script>
</body>
</html>